<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="rich" uri="http://richfaces.org/rich"%>
<%@ taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<f:view>
	<a4j:form>
		<rich:panel style="width:500px; margin:auto;">
			<f:facet name="header">
				<h:outputLabel value="Rechercher multi-criteres" />
			</f:facet>
			<h:panelGrid columns="2">
				<h:outputLabel value="critere medecin : " />
				<h:panelGroup>
					<h:panelGrid columns="2">
						<h:inputText id="medecin" value="#{mbAcceuil.saisieMedecin}"
							styleClass="textBox" size="50" />
					</h:panelGrid>
					<rich:suggestionbox id="suggestionBoxId1" for="medecin"
						suggestionAction="#{mbAcceuil.autoCompleteMedecin}" var="result"
						tokens="," height="150" width="160" cellpadding="2"
						cellspacing="2" shadowOpacity="4" shadowDepth="4" minChars="1"
						rules="none" nothingLabel="No se encontro nada">
						<h:column>
							<h:outputText value="#{result}" style="font-style:bold" />
						</h:column>
					</rich:suggestionbox>
				</h:panelGroup>

				<h:outputLabel value="critere Date" />
				<rich:calendar value="#{mbAcceuil.selectedDate}"
					datePattern="yyyy-MM-dd" />

				<h:outputLabel value="critere Patient" />
				<h:panelGroup>
					<h:panelGrid columns="2">
						<h:inputText id="patient" value="#{mbAcceuil.saisiePatient}"
							styleClass="textBox" size="50" />
					</h:panelGrid>
					<rich:suggestionbox id="suggestionBoxId2" for="patient"
						suggestionAction="#{mbAcceuil.autoCompletePatient}" var="result"
						tokens="," height="150" width="160" cellpadding="2"
						cellspacing="2" shadowOpacity="4" shadowDepth="4" minChars="1"
						rules="none" nothingLabel="No se encontro nada">
						<h:column>
							<h:outputText value="#{result}" style="font-style:bold" />
						</h:column>
					</rich:suggestionbox>
				</h:panelGroup>

				<h:outputLabel value=" " />
				<a4j:commandButton action="#{mbAcceuil.rechercheEvenement}"
					reRender="tabEvenement" value="Recherche Evenements"
					styleClass="testButton" style="testButton fontBackgroundColor">
				</a4j:commandButton>

			</h:panelGrid>
		</rich:panel>

		<rich:panel>
			<a4j:outputPanel id="tabEvenement">
				<h:outputText rendered="#{not empty mbAcceuil.message }" value="#{mbAcceuil.message}"
				style="font-color:red;" />
				<rich:dataTable rendered="#{not empty  mbAcceuil.listEvenement}"
					value="#{mbAcceuil.listEvenement }" var="evenement">
					<rich:column>
						<f:facet name="header">
							<h:outputText value="heureDebut" style="text-align:left;"></h:outputText>
						</f:facet>
						<h:outputText value="#{evenement.heureDebut }"></h:outputText>
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="heureFin" style="text-align:left;"></h:outputText>
						</f:facet>
						<h:outputText value="#{evenement.heureFin }"></h:outputText>
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="Message" style="text-align:left;"></h:outputText>
						</f:facet>
						<h:outputText value="#{evenement.message}"></h:outputText>
					</rich:column>
				</rich:dataTable>
			</a4j:outputPanel>
		</rich:panel>
	</a4j:form>
</f:view>
</body>
</html>